package com.kingwang.training.designpattern.lod.bo.lod;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@EqualsAndHashCode
@ToString
public class Customer {
    @Getter
    @Setter
    private String name;

    @Getter
    @Setter
    private String cellPhone;

    @Setter
    private Wallet wallet;

    /**
     * 顾客自己付款
     *
     * @param payment
     */
    public void pay(Double payment) {
        if (this.wallet.getMoney() > payment) {
            this.wallet.subtractMoney(payment);
        } else {
            // 钱不够
        }
    }
}
